package Model2HomeWork;
//通话套餐类 特征：通话时长、短信条数、每月资费 行为: 显示所有套餐信息

public class CallPackages extends Plan implements CallService  {
    private double talkTime;//通话时长
    private double priceMonth;//每月资费
    private int messageNum;//短信条数

    public CallPackages() {
    }

    public CallPackages(double talkTime, int messageNum, double priceMonth) {
        this.talkTime = talkTime;
        this.messageNum = messageNum;
        this.priceMonth = priceMonth;
    }
    //getter and setter
    public double getTalkTime() {
        return talkTime;
    }

    public int getMessageNum() {
        return messageNum;
    }

    public double getPriceMonth() {
        return priceMonth;
    }

    public void setTalkTime(double talkTime) {
        this.talkTime = talkTime;
    }

    public void setMessageNum(int messageNum) {
        this.messageNum = messageNum;
    }

    public void setPriceMonth(double priceMonth) {
        this.priceMonth = priceMonth;
    }
    //打印套餐信息
    public void showCallPag(){
        System.out.println("当前通话套餐中，每月通话时长为：" + talkTime +
                "短信条数为：" + messageNum +
                "每月资费：" + priceMonth);
    }
    @Override
    public void getPayment(){
        System.out.println("当前通话套餐中，每月通话时长为：" + getTalkTime() + "分钟" + " " +
                "短信条数为：" + getMessageNum() + "条" + " "  +
                "每月资费：" + getPriceMonth() + "元");

    }

    @Override
    public void call(double callTime, SIMCard sc) {
        System.out.println("实现通话服务接口");
        System.out.println("通话时间：" + callTime + " " + "手机卡类型" + sc);
    }

}
